import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/home'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    meta: {
      isshow: true
    }
  },


  {
    path: '/topic',
    name: 'topic',
    component: () => import("@/views/topic")
  },
  {
    path: '/category',
    name: 'category',
    component: () => import('@/views/category'),
    meta: {
      isshow: true
    }
  },
  {
    path: '/search',  //搜索界面
    name: 'search',
    component: () => import('@/views/Search')
  },
  {
    path: '/cart',
    name: 'cart',
    component: () => import('@/views/cart'),
    meta: {
      isshow: true
    }
  },
  {
    path: '/mine',
    name: 'mine',
    component: () => import('@/views/mine'),
    meta: {
      isshow: true
    }
  },
  {
    path: '/address',
    component: () => import('@/views/addressList'),
    meta: {
      isshow: true
    }
  },
  {
    path: '/usermsg',
    component: () => import('@/views/usermsg'),
    meta: {
      isshow: true
    }
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login'),
    meta: {
      isshow: true
    }
  },
  {
    path: '/cart/paddress',
    name: 'paddress',
    component: () => import('@/views/cart/Paddress.vue'),
  },
  {
    path: '/cart/cdetil',
    name: 'cdetil',
    component: () => import('@/views/cart/Cdetil.vue'),
  },
  {
    path: '/cart/order',
    name: 'order',
    component: () => import('@/views/cart/order.vue'),
  },
  {
    path: '/search/list',  //搜索-->列表界面
    name: 'searchList',
    component: () => import('@/views/Searchlist')
  },
  {
    path:'/home/ctogry',  //首页-->商品分类详情
    name:'ctogryIntroduction',
    component:()=>import('@/views/home/ctogryIntroduction.vue')
   },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login'),
    meta: {
      isshow: true
    }
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
